<div id="border">
<form method="post" name="">
  <div id="left_content">
  	<div class="title">
	<div class="cat_name">
    <table width="100%" border="0">
      <tr>
        <td width="61%"><img src="<?=base_url();?>images/t-shirt.png" height="18" align="left" /><h2>&nbsp;<?=$Z_TRANS->value('menu_classified_ads')?></h2></td>
        <td width="39%" align="right" class="more_menu">
        	<a href="<?=site_url("classify/goto_addnew_classify");?>"><?=$Z_TRANS->value('menu_post_Free_ads')?></a>&nbsp;&nbsp;
            <a href="<?=site_url("classify")?>"><?=$Z_TRANS->value('menu_more_classified')?></a></td>
      </tr>
    </table>
 	</div>
   <?php $str_path = str_replace("\\", "/", FCPATH);
   		 foreach($all_ads->result() as $ads):
   		 $getimg=$this->m_classify->select_first_img($ads->product_id);		 
		 ?>
        <table width="100%" border="0" class="left_ttb_border">
           <tr>
               <td width="106" valign="top" align="center">
              <?php 
			    //$filename =$str_path.$ads->file_path.$getimg['img_name'];
			  	$file_name1 = current(explode(".", $getimg['img_name']));
				$file_ext1  = next(explode(".", $getimg['img_name']));
				$filename = $str_path.$ads->file_path.$file_name1."_Thumb.".$file_ext1;
				?>
              	<a href="<?=site_url("classify/goto_classify_detail/$ads->product_id")?>">
                 	<?php if($getimg['img_name']!='' && file_exists ($filename)){ ?>
                        <img src="<?=base_url();?><?=$ads->file_path;?><?=$file_name1."_Thumb.".$file_ext1;?>" height="68" width="68" border="0" />
                 	<?php }else{?>
                        <img src="<?=base_url();?>images/nopic.gif" width="68"/>
                 	<? } ?>
                </a>
               </td>
               <td width="429" valign="top">
               		<b><a href="<?=site_url("classify/goto_classify_detail/".$ads->product_id)?>"><?=substr(htmlspecialchars($ads->product_name),0,39)." ";?></a> &nbsp;<span class="price">$<?=$ads->price;?></span></b><br />
               		<?=substr(htmlspecialchars($ads->product_desc),0,49)."..";?>
               </td>
             <td width="85" valign="top"></td>
               <td width="99" valign="top"><?=htmlspecialchars(date_postgres_to_html($ads->date_post));?><br />
          			<?=$Z_TRANS->value('title_from')?> <?=$ads->user_login;?><br /> <?php $total_hit=$this->m_classify->get_product_hit($ads->product_id); ?>
          			<font class="price"><?=count($total_hit->result());?></font> <?=$Z_TRANS->value('title_hit')?>
       		 </td>
             </tr>
           </table>
    <? endforeach;?>
    </div>
    <a href="<?=site_url("user_tracking/ads/yakocomputer.com")?>" target="_blank"><img src="<?=base_url();?>ads/yako-may.gif" width="705" height="71" border="0" /></a>
<div class="title" style="display:none">
  <div class="cat_name">
    <table width="100%" border="0">
      <tr>
        <td width="61%"><img src="<?=base_url();?>images/hand_pro_icon&16.png" height="16" align="left" /><h2>&nbsp;<?=$Z_TRANS->value('menu_voting')?></h2></td>
        <td width="39%" align="right" class="more_menu"><a href="<?=site_url("job_wanted")?>"><?=$Z_TRANS->value('menu_vote_now')?></a>&nbsp;&nbsp;<a href="<?=site_url("vote")?>"><?=$Z_TRANS->value('menu_more_vote')?></a></td>
      </tr>
    </table>
 	</div>
    <?php 
    foreach($events->result_array() as $event):?>
    <table width="100%" border="0" class="left_ttb_border">
        <tr>
          <td width="106" valign="top" align="center"><a href="<?=site_url("vote/voteDetail/".$event['event_id'])?>"><img src="<?=base_url();?>images/nopic.gif" width="68" border="0" /></a></td>
          <td valign="top" width="429"><b><a href="<?=site_url("vote/voteDetail/".$event['event_id'])?>"><?=htmlspecialchars($event['top_name'])?></a></b><p align="justify" style="font-size: 12px;"><?=htmlspecialchars($event['top_desc'])?></td>
          <td width="85" valign="top">&nbsp;</td>
          <td width="99" valign="top"><b>Closed on</b><br><?=$event['end_date']?></td>
        </tr>
  	</table>
	<?php endforeach;?>	
  </div>
   
    <div class="title">
    <div class="cat_name">
    <table width="100%" border="0">
      <tr>
        <td width="61%"><img src="<?=base_url();?>images/case_icon&24.png" height="16" align="left" /><h2>&nbsp;<?=$Z_TRANS->value('menu_job_announ')?>&nbsp;</h2></td>
        <td width="39%" align="right" class="more_menu"><a href="<?=site_url("")?>"><?=$Z_TRANS->value('menu_post_job')?></a>&nbsp;&nbsp;<a href="<?=site_url("front_job_announ/goto_job_page")?>"><?=$Z_TRANS->value('menu_more_job')?></a></td>
      </tr>
    </table>
    </div>
    <?php foreach($all_company->result() as $announ):?>
        <table width="100%" border="0" class="left_ttb_border">
            <tr>
              <td width="106" valign="top" align="center">
              <a href="<?=site_url("front_job_announ/view_job_by_company/$announ->com_id")?>" >
              <?php //$filename =$str_path.$ads->file_path.$announ->com_logo_name;
			  if($announ->com_logo_type<>''){ ?>
                <img src="<?=site_url("front_job_announ/showcompanylogo/$announ->com_id")?>" width="90" height="60"/>
              <?php }else{?>
                <img src="<?=base_url();?>images/nopic.gif" width="68"/>
              <? } ?>
              </a>
              </td>
              <td width="429" valign="top">
          	<a href="<?=site_url("front_job_announ/view_job_detail/$announ->announ_id")?>">
            <b><?=htmlspecialchars($announ->com_name);?></b><br /></a>
            	<?php
				$alltitle=$this->front_m_job->get_title_by_announid($announ->announ_id);
				$i=0;
				foreach($alltitle->result() as $title):
				?>
                <?=htmlspecialchars($title->title_desc);?>
                <?php $i=$i+1;
				if($i<count($alltitle->result())){?>
                /
                <? } ?>
				<? endforeach;?>
                <td width="85" valign="top">&nbsp;</td>
              <td width="99" valign="top"><?=htmlspecialchars(date_postgres_to_html($announ->date_close));?><br />
              <?php $total_hit_job=$this->front_m_job->get_hit_job($announ->announ_id); ?>
          <font class="price"><?=count($total_hit_job->result());?></font> <?=$Z_TRANS->value('title_hit')?>
          </td>
          
          </tr>
        </table>
    	<? endforeach;?>
    </div>
	    <a href="<?=site_url("user_tracking/ads/btkplaza.com")?>" target="_blank"><img src="<?=base_url();?>ads/btkfood.gif" width="705" height="71" border="0" /></a>
    <div class="title">
    <div class="cat_name">
    <table width="100%" border="0">
      <tr>
        <td width="61%"><img src="<?=base_url();?>images/user_icon&16.png" align="left" /><h2>&nbsp;<?=$Z_TRANS->value('menu_job_wanted')?></h2></td>
        <td width="39%" align="right" class="more_menu"><a href="<?=site_url("job_wanted")?>"><?=$Z_TRANS->value('menu_post_job')?></a>&nbsp;&nbsp;<a href="<?=site_url("job_wanted/job_wanted_list")?>"><?=$Z_TRANS->value('menu_more_job')?></a></td>
      </tr>
    </table>
	</div>
    <?php foreach($jobwanted->result() as $rowJobwanted):?>
    <table width="100%" border="0" class="left_ttb_border">
        <tr>
    	<td width="106" valign="top" align="center">
          <?php $jobwanted_hits = $this->m_jobwanted->get_jobwanted_hit($rowJobwanted->job_wan_id);
		  	   $filename=$str_path."usr/".$rowJobwanted->user_id."/".$rowJobwanted->user_photo;
		  		if($rowJobwanted->user_photo!='' && file_exists ($filename)){ ?>
          	<img src="<?=base_url();?>usr/<?=$rowJobwanted->user_id?>/<?=$rowJobwanted->user_photo?>" height="60"/>
          <?php }else{?>
          	<img src="<?=base_url();?>images/nopic.gif" width="68"/>
          <? } ?>
          </td>
          <td width="429" valign="top" style="padding-right:10px;"><b><a href="<?=site_url("job_wanted/detail/".$rowJobwanted->job_wan_id)?>"><?=substr(htmlspecialchars($rowJobwanted->job_wan_subject),0,100);?></a></b><br /><?=substr(htmlspecialchars($rowJobwanted->job_wan_desc),0,100);?></td>
          <td width="85" valign="top">&nbsp;</td>
          <td width="99" valign="top"><?=datetime_postgres_to_html($rowJobwanted->date_create);?><br /><?=$Z_TRANS->value('title_from')?> <?=$rowJobwanted->user_login?><br /><font class="price"><?=count($jobwanted_hits->result());?></font> <?=$Z_TRANS->value('title_hit')?></td>
        </tr>
  	</table>
   <? endforeach;?>
    </div>
	<a href="<?=site_url("user_tracking/ads/koungy.com")?>" target="_blank"><img src="<?=base_url();?>ads/koungy.gif" width="705" height="71" border="0" /></a>    
    <div class="title">
    <div class="cat_name">
    <table width="100%" border="0">
      <tr>
        <td width="61%"><img src="<?=base_url();?>images/home_icon&16.png" height="16" align="left" /><h2>&nbsp;<?=$Z_TRANS->value('menu_property')?></h2></td>
        <td width="39%" align="right" class="more_menu"><a href="<?=site_url("property/p")?>"><?=$Z_TRANS->value('menu_post_property')?></a>&nbsp;&nbsp;<a href="<?=site_url("property")?>"><?=$Z_TRANS->value('menu_more_property')?></a></td>
      </tr>
    </table>
    </div>
    <?php foreach($result_pro->result_array() as $row_pro): ?>
    <table width="100%" border="0" class="left_ttb_border">
        <tr>
          <td width="106" align="center" valign="top">
          <? 
		  	$property_hits = $this->m_property->get_property_hit($row_pro['property_id']);
			$file_name = current(explode(".", $row_pro['pic_name']));
			$file_ext  = next(explode(".", $row_pro['pic_name']));
			$filename =$str_path.$row_pro['file_path'].$row_pro['pic_name'];
			//$file_path_thumb=$str_path."usr/".htmlspecialchars($Z_USER["user_id"]).'/'.$file_name."_Thumb.".$file_ext;
		  	if($row_pro['pic_name']!="" && file_exists ($filename)){?>
          		<a href="<?=site_url("property/detail/".$row_pro['property_id'])?>"><img src="<?=base_url();?><?=$row_pro['file_path'];?><?=$file_name."_Thumb.".$file_ext;?>" height="60" border="0" /></a>
          <? } else {?>
          		<img src="<?=base_url();?>images/nopic.gif" width="68" />
		  <? }?>
          </td>
          <td width="429" valign="top"><b><a href="<?=site_url("property/detail/".$row_pro['property_id'])?>">  <? echo substr($row_pro['property_name'],0,39)." ";?></a></b><span class="price">$<?=$row_pro['property_price']?></span><div class="cat_desc"><? echo substr($row_pro['description'],0,49)."..";?></div></td>
          <td width="85" valign="top"></td>
          <td width="99" valign="top">
          <?=datetime_postgres_to_html($row_pro['date_create'])?><br /> 
          <?=$Z_TRANS->value('title_from')?> <?=$row_pro['user_upload']?><br /><font color="#961C1C"><?=count($property_hits->result());?></font> <?=$Z_TRANS->value('title_hit')?>
          </td>
        </tr>
  	</table>
	<?php endforeach;?>	
    </div>
    <a href="<?=site_url("user_tracking/ads/asiagarden.com.kh/mk.htm")?>" target="_blank"><img src="<?=base_url();?>ads/mk_780x100.gif" width="705" height="80" border="0" /></a>  
  </div>
    <?php include APPPATH."views/templates/common/right_content.php"; ?>

</form>
</div>